import React, { useState, useMemo } from 'react'

const s=new Set();
function UseMemo() {
    const [num, setNum] = useState(0);
    const MemoCom = useMemo(() => {
        return <p className="text text-danger">{new Date().getTime()}</p>
    }, [Math.floor(num / 10)])
    const increment = () => {
        setNum(num => num + 1)
    }
    s.add(increment)
    console.log(s.size)
    return (
        <div className="container">
			<h4 className='display-4'>{num}</h4>
			{MemoCom}
			<button onClick={increment} className='btn btn-primary'>增加</button>
		</div>
    )
}

export default UseMemo